import svgCaptcha from 'svg-captcha'

class PublicController {
  constructor() {}
  async getCaptcha(ctx) {
    const newCaptcha = svgCaptcha.create({
      size: 6,
      ignoreChars: '0o1il',// 去掉容易混淆但字符
      color: true,
      noise: Math.floor(Math.random() * 5),// 干扰线，随机
      width: 150,
      height: 50,
    })
    console.log(newCaptcha);
    ctx.body = {
      code:200,
      data: newCaptcha.data
    }
  }
}

export default new PublicController();